package com.xingu.xg.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel("节点复制粘贴参数")
public class CopyNodeQuery {
    @ApiModelProperty(value = "选中节点ID", required = true)
    @NotNull(message = "选中节点ID不能为空")
    private String selectedId;

    @ApiModelProperty(value = "复制的节点列表", required = true)
    @Valid
    @NotEmpty(message = "复制节点列表不能为空")
    private List<NodeInfo> nodes;

    @Data
    public static class NodeInfo {
        @ApiModelProperty(value = "原节点ID", required = true)
        @NotNull(message = "原ID不能为空")
        private String originalId;

        @ApiModelProperty("原父级节点ID")
        private String originalParentId;

        @ApiModelProperty(value = "节点名称", required = true)
        private String nodeName;

        @ApiModelProperty("节点类型")
        private String nodeType;

        @ApiModelProperty("数量")
        private BigDecimal quantity;

        @ApiModelProperty("单位")
        private String unit;

        @ApiModelProperty("子节点列表")
        private List<NodeInfo> children;
    }
}
